#include<stdio.h>
int is_prime(int j);
int main() {
	int m, n;
	scanf_s("%d %d", &m, &n);
	int sum = 0;
	int count = 0;
	int j;
	for (int j = m; j <= n; j++) {
		is_prime(j);
		if (is_prime(j) == 0) {
			sum += j;
			count++;
		}
	}
	printf("%d %d", count, sum);
}
int is_prime(int j) {
	int prime = 0;
	for (int i = 2; i < j; i++) {
		if (j % i == 0) {
			prime = 1;
			break;
		}
		}
	return prime;
	}